package com.du.cloud.security.exception;

import com.du.cloud.security.component.CustomAuth2ExceptionSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.http.HttpStatus;

/**
 * Desc: 拒绝访问
 * Author: dushuang
 * Date: 2020/5/26
 **/
@JsonSerialize(using = CustomAuth2ExceptionSerializer.class)
public class ForbiddenException extends CustomAuth2Exception {

    public ForbiddenException(String msg, Throwable t) {
        super(msg, t);
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "access_denied";
    }

    @Override
    public int getHttpErrorCode() {
        return HttpStatus.FORBIDDEN.value();
    }
}
